/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

#ifndef _JOYSTICK_PAGE_H
#define _JOYSTICK_PAGE_H

#include "NodePages.h"
#include "myStripChart.h"

class JoystickPage : public NodePage
{
	public:
		virtual void update();
		virtual bool create_page(Client *client, GtkBuilder *builder);
		virtual void setCMD_RX(uint8_t cmd_id, int ack_nack=-1);

	protected:
		//--------------------PAGE VARIABLES--------------------//
		//
		//-- display --//
		//   in this section, add the names of the widgets you designed
		//   in glade for the page you are creating

		//-- input entry --//
		//  in this section, add any input boxes you gave to the user
		//  for input selection, can be buttons, text input, check boxes, ...
		GtkWidget *axis0_slider;
		GtkWidget *axis1_slider;
		GtkWidget *axis2_slider;
		GtkWidget *axis3_slider;
		GtkWidget *button0;
		GtkWidget *button1;
		GtkWidget *button2;
		GtkWidget *button3;
		GtkWidget *joystick_enable;
		GtkWidget *joystick_stop;

		//-- callbacks --//
		//  in this section, add any of the callbacks you need to handle
		//  user input. Note, more than likely these will need to be static functions.
		//  Also, for the pointer we pass the WindowStruct pointer, which provides
		//  all the inormatio necessary to dray any/all pages
		
		// send orbital values
		static void joystick_enable_clicked(GtkButton *widget, gpointer data); 
		// stop tracking and clear selected nodes
		static void joystick_stop_clicked(GtkButton *widget, gpointer data); 
	  void set_axis_and_button_states();

		//-- Command buttons --//
		void set_js_client();
		void unset_js_client();
};
#endif
